home *** CD-ROM | disk | FTP | other *** search
/ Mac Mania 2 / MacMania 2.toast / Demo's / Tools&Utilities / Programming / CopyFile / READ THIS FIRST! < prev   
Encoding:
Text File  |  1994-04-23  |  3.1 KB  |  101 lines  |  [TEXT/ttxt]

  1. CopyFile
  2. ========
  3.  
  4. written on Saturday, 23th of April 1994
  5. (a sunny day, its a pitty I have to work)
  6.  
  7. A sample application illustrating how to copy a file on Macintosh
  8. ----------------------------------------------------------
  9.  
  10. Credits:        This application is based on gencopy, originaly
  11.                                 written in 1987 by Jerry LeVan, Richmond
  12.                                 for MPW C v1.0 on MacPlus with Finder 5.3 and System v3.2
  13.  
  14.                                 The introduction found in CopyFile.c was left unchanged.
  15.  
  16. What is it?
  17. ----------
  18.  
  19. I changed the original application to be compiled with Symantec C++ 6.0 for System 7.x.
  20. Therefore I did the following:
  21.  
  22.     -    Changed the file name to CopyFile.c (fount it more illustrative)
  23.  
  24.     -    Built a Project File for Think Project Manager 
  25.  
  26.     -    Separated the Rez-Source-Code from the C-Source-Code
  27.             into the File CopyFile.r
  28.  
  29.     -    Added the necessary #include "Types.r" for Think Rez.
  30.  
  31.     -    Beautified the source code to understand its structure !-)
  32.  
  33.     -    Killed the includes, because Symantec C++ automaticaly
  34.             includes all necessary header files by default
  35.  
  36.     -    Replaced all assignment-comparisons 
  37.                     if ( (a = b) == c); becomes a = b; if (a == c);
  38.             to avoid the warning about a maybe "uninteded assignment"
  39.  
  40.     -     Changed all function declarations to ANSI-Standard
  41.                     
  42.                 funcname(a)
  43.                 int a;
  44.  
  45.             becomes
  46.  
  47.                 funcname(int a)
  48.  
  49.     -    Fixed a bug found this way in the call to the function CopyDataFork.
  50.             The parameter called creator was missing. :-(
  51.  
  52.     -    Compiled and tested it on a Quadra 950 (the appropriate machine for
  53.             this application) and found it worked.
  54.  
  55.     -    Changed the buffer size from 1024 to 8192. If You use a machine with
  56.             64 MB RAM, it does not matter, but it is much faster.
  57.  
  58. Who is it?
  59. ---------
  60.  
  61. My name and adress is:
  62.  
  63.         Torsten Schlabach
  64.         Harzburgerstr. 16
  65.         D-47259 Duisburg
  66.         Germany
  67.  
  68.         Phone: +49 - 203 - 784 292
  69.         E-mail:    CompuServe:        100335,243
  70.                                     Internet:                    100335,243@Compuserve.com
  71.  
  72. Problems and possible improvements
  73. ---------------------------------
  74.  
  75. If the file You try to copy is open, everything seems to work correctly,
  76. but the destination file is empty. Feel free the fix it. I could not do so,
  77. because my mam wanted me to have dinner now.
  78.  
  79. In System 7.x there is a function called PBHCopyFile, wich allows copying
  80. a file on the same volume or between different volumes on the same
  81. AppleTalk-Fileserver. This avoids transferring the file twice trough
  82. the network. Feel free to let the application recognize, if the
  83. circumstances allow the use of this function and then call it.
  84.  
  85. For gaining higher speed, why not find out the total file size and
  86. try to allocate a buffer that is big enogh to allow copying the file with
  87. one read and one write operation per fork.
  88.  
  89. Copyright
  90. ---------
  91.  
  92. This application is provided as is without any warranties. It is as 
  93. free as the underlying gencopy.c by Jerry LeVan.
  94.  
  95. Interested in a C++-Class for Copying files? Or in other C++-Classes?
  96. -----------------------------------------------------------------
  97.  
  98. I developed some C++-classes for use with Think C/Symantec C++, which I sell 
  99. for a symbolic price of $5 each. Please contact me through Compuserve for a
  100. complete list or ask me for a specific class.
  101.